<%@ page import="com.code.demo.CaptcahCode" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    // 禁止浏览器缓存
    response.setHeader("pragma", "no-cache");
    response.setHeader("cache-control", "no-cache");
    response.setHeader("expires", "0");

    // 调用生成验证码的工具类
    String code = CaptcahCode.drawImageVerificate(response);
    session.setAttribute("code", code);

    // 解决 getOutputStream 异常问题
    out.clear();
    out = pageContext.pushBody();
%>
